<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}本地图书馆{% endblock %}</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <style>
        :root {
            --primary-color: #ff9999; #顶底
            --secondary-color: #34495e;
            --accent-color: #3498db;
        }

        body {
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            background-color: #f2e5ff; #背景
        }

        .navbar {
            background-color: var(--primary-color);
            box-shadow: 0 2px 4px rgba(0,0,0,.1);
        }

        .navbar-brand {
            font-weight: 600;
            color: white !important;
        }

        .nav-link {
            color: rgba(255,255,255,.8) !important;
            transition: color 0.3s ease;
        }

        .nav-link:hover {
            color: white !important;
        }

        .card {
            border: none;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,.1);
            transition: transform 0.3s ease;

        }

        .card:hover {
            transform: translateY(-5px);
            '''background-color: #FFFFE0;'''
        }

        .btn-primary {
            background-color: var(--accent-color);
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
        }

        .btn-primary:hover {
            background-color: #2980b9;
        }

        .sidebar {
            background-color: #ffe6cc; #导航栏
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,.1);
        }

        .list-group-item {
            border: none;
            padding: 12px 20px;
            margin-bottom: 5px;
            border-radius: 5px;
            transition: background-color 0.3s ease;
        }

        .list-group-item:hover {
            background-color: #FFF0F5; #光标
        }

        .footer {
            background-color: var(--primary-color);
            color: white;
            padding: 20px 0;
            margin-top: 50px;
        }
    </style>
    {% block extra_css %}{% endblock %}
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark mb-4">
        <div class="container">
            <a class="navbar-brand" href="{% url 'index' %}">
                <i class="fas fa-book-reader me-2"></i>本地图书馆
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'index' %}">
                            <i class="fas fa-home me-1"></i>首页
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'books' %}">
                            <i class="fas fa-book me-1"></i>所有图书
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'author-list' %}">
                            <i class="fas fa-user-edit me-1"></i>作者
                        </a>
                    </li>
                </ul>
                <div class="navbar-nav">
                    {% if user.is_authenticated %}
                        <a class="nav-link" href="{% url 'my-borrowed' %}">
                            <i class="fas fa-bookmark me-1"></i>我的借阅
                        </a>
                        <form action="{% url 'logout' %}" method="post" style="display:inline;">
                            {% csrf_token %}
                            <button type="submit" class="nav-link btn btn-link" style="display:inline; padding:0; border:none; background:none;">
                                <i class="fas fa-sign-out-alt me-1"></i>退出
                            </button>
                        </form>
                    {% else %}
                        <a class="nav-link" href="{% url 'login' %}">
                            <i class="fas fa-sign-in-alt me-1"></i>登录
                        </a>
                    {% endif %}
                </div>
            </div>
        </div>
    </nav>

    <!-- 主要内容 -->
    <div class="container">
        <div class="row">
            <div class="col-md-9">
                {% block content %}{% endblock %}
            </div>
            <div class="col-md-3">
                <div class="sidebar">
                    <h5 class="mb-3">快速导航</h5>
                    <div class="list-group">
                        <a href="{% url 'index' %}" class="list-group-item">
                            <i class="fas fa-chart-bar me-2"></i>统计概览
                        </a>
                        <a href="{% url 'books' %}" class="list-group-item">
                            <i class="fas fa-list me-2"></i>图书列表
                        </a>
                        <a href="{% url 'author-list' %}" class="list-group-item">
                            <i class="fas fa-users me-2"></i>作者列表
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer class="footer mt-5">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <h5>关于我们</h5>
                    <p>本地图书馆管理系统提供图书借阅、管理等服务。</p>
                </div>
                <div class="col-md-6 text-md-end">
                    <h5>联系我们</h5>
                    <p>
                        <i class="fas fa-envelope me-2"></i>Email: plave@asterum.com<br>
                        <i class="fas fa-phone me-2"></i>电话: (plv) cbb-0715
                    </p>
                </div>
            </div>
        </div>
    </footer>

    <!-- Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    {% block extra_js %}{% endblock %}
</body>
</html>